<head><title>Python: module eda_1213</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>eda_1213</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/python27/lib/5625_6313/eda_1213.py">c:\python27\lib\5625_6313\eda_1213.py</a></font></td></tr></table>
    <p><tt>#&nbsp;-*-&nbsp;coding:&nbsp;utf-8&nbsp;-*-</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="eda_1213.html#Algorithm">Algorithm</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Algorithm">class <strong>Algorithm</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;class&nbsp;<a href="#Algorithm">Algorithm</a>&nbsp;faz&nbsp;a&nbsp;gestão&nbsp;dos&nbsp;algoritmos,&nbsp;recebe&nbsp;como&nbsp;parâmetro&nbsp;o&nbsp;nome&nbsp;do&nbsp;algoritmo&nbsp;e&nbsp;chama&nbsp;a&nbsp;classe&nbsp;correspondente<br>
&nbsp;<br>
Parâmetros&nbsp;de&nbsp;entrada:<br>
algorithm:&nbsp;Algoritmo&nbsp;a&nbsp;ser&nbsp;analisado<br>
maxRange:&nbsp;Tamanho&nbsp;n&nbsp;da&nbsp;útilma&nbsp;lista<br>
hop:&nbsp;Diferença&nbsp;de&nbsp;tamanho&nbsp;entre&nbsp;as&nbsp;listas<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exemplo:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hop&nbsp;=&nbsp;50<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;da&nbsp;primeira&nbsp;lista&nbsp;=&nbsp;50<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;da&nbsp;segunda&nbsp;lista&nbsp;=&nbsp;100<br>
it:&nbsp;Número&nbsp;de&nbsp;vezes&nbsp;que&nbsp;um&nbsp;algoritmo&nbsp;irá&nbsp;ser&nbsp;testado&nbsp;(Para&nbsp;se&nbsp;obter&nbsp;a&nbsp;média&nbsp;dos&nbsp;tempos&nbsp;obtidos)<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Algorithm-__init__"><strong>__init__</strong></a>(self, algorithm, maxRange, hop, it)</dt></dl>

<dl><dt><a name="Algorithm-allAlgorithmAnalysis"><strong>allAlgorithmAnalysis</strong></a>(self)</dt><dd><tt>Método&nbsp;que&nbsp;percorre&nbsp;todos&nbsp;os&nbsp;algoritmos,&nbsp;faz&nbsp;a&nbsp;média&nbsp;de&nbsp;todos&nbsp;e&nbsp;chama&nbsp;o&nbsp;objecto&nbsp;que&nbsp;executa&nbsp;o&nbsp;gráfico&nbsp;sendo&nbsp;o&nbsp;X&nbsp;o&nbsp;número&nbsp;de&nbsp;elementos&nbsp;da&nbsp;lista&nbsp;e&nbsp;o&nbsp;Y<br>
as&nbsp;médias&nbsp;de&nbsp;tempo&nbsp;entre&nbsp;os&nbsp;5&nbsp;algoritmos&nbsp;testados</tt></dd></dl>

<dl><dt><a name="Algorithm-callGraph"><strong>callGraph</strong></a>(self, G)</dt><dd><tt>Parâmetro&nbsp;de&nbsp;entrada:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lista&nbsp;G&nbsp;que&nbsp;contêm&nbsp;N&nbsp;indices,&nbsp;em&nbsp;que&nbsp;cada&nbsp;indice&nbsp;é&nbsp;um&nbsp;tuplo&nbsp;que&nbsp;contêm&nbsp;o&nbsp;tamanho&nbsp;da&nbsp;lista&nbsp;ordenada&nbsp;e&nbsp;a&nbsp;média&nbsp;dos&nbsp;tempos&nbsp;da&nbsp;mesma<br>
&nbsp;<br>
Variáveis&nbsp;deste&nbsp;método:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;-&nbsp;Lista&nbsp;com&nbsp;o&nbsp;tamanho&nbsp;das&nbsp;listas&nbsp;que&nbsp;foram&nbsp;ordenadas<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Y&nbsp;-&nbsp;Lista&nbsp;com&nbsp;a&nbsp;média&nbsp;dos&nbsp;tempos<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Z&nbsp;-&nbsp;Valor&nbsp;teórico&nbsp;aplicado&nbsp;ao&nbsp;algoritmo<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;-&nbsp;Variância&nbsp;dos&nbsp;tempos<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D&nbsp;-&nbsp;Desvio&nbsp;Padrão<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E&nbsp;-&nbsp;Erro&nbsp;amostral<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T&nbsp;-&nbsp;Valor&nbsp;tabelar<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Chama&nbsp;o&nbsp;método&nbsp;da&nbsp;classe&nbsp;que&nbsp;desenha&nbsp;o&nbsp;gráfico.&nbsp;O&nbsp;construtor&nbsp;deste&nbsp;método&nbsp;é&nbsp;a&nbsp;lista&nbsp;com&nbsp;o&nbsp;tamanho&nbsp;das&nbsp;listas,&nbsp;&nbsp;uma<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lista&nbsp;com&nbsp;todos&nbsp;os&nbsp;valores&nbsp;do&nbsp;eixo&nbsp;Y&nbsp;a&nbsp;serem&nbsp;desenhados&nbsp;e&nbsp;os&nbsp;valores&nbsp;da&nbsp;tabela</tt></dd></dl>

<dl><dt><a name="Algorithm-chooseAlgorithm"><strong>chooseAlgorithm</strong></a>(self)</dt><dd><tt>Chama&nbsp;a&nbsp;class&nbsp;correspondente&nbsp;à&nbsp;classe&nbsp;do&nbsp;algoritmo&nbsp;necessária</tt></dd></dl>

<dl><dt><a name="Algorithm-fillList"><strong>fillList</strong></a>(self, n)</dt><dd><tt>Enche&nbsp;a&nbsp;lista&nbsp;de&nbsp;tamanho&nbsp;n&nbsp;com&nbsp;números&nbsp;randomizados&nbsp;entre&nbsp;0.0&nbsp;e&nbsp;1.0</tt></dd></dl>

<dl><dt><a name="Algorithm-startAnalysis"><strong>startAnalysis</strong></a>(self)</dt><dd><tt>Método&nbsp;que&nbsp;faz&nbsp;a&nbsp;análise&nbsp;do&nbsp;algoritmo<br>
Percorre&nbsp;a&nbsp;lista&nbsp;que&nbsp;contêm&nbsp;o&nbsp;tamanho&nbsp;das&nbsp;listas&nbsp;a&nbsp;serem&nbsp;ordenadas,&nbsp;de&nbsp;seguida&nbsp;entra-se&nbsp;no&nbsp;loop&nbsp;que&nbsp;define&nbsp;que&nbsp;o&nbsp;algoritmo&nbsp;irá&nbsp;ser&nbsp;corrido&nbsp;it&nbsp;vezes<br>
por&nbsp;cada&nbsp;n&nbsp;escolhido.<br>
&nbsp;<br>
É&nbsp;chamado&nbsp;o&nbsp;método&nbsp;para&nbsp;encher&nbsp;a&nbsp;lista&nbsp;de&nbsp;tamanho&nbsp;n&nbsp;com&nbsp;valores&nbsp;aleatórios,&nbsp;posteriormente&nbsp;é&nbsp;chamado&nbsp;o&nbsp;algoritmo&nbsp;de&nbsp;ordenação&nbsp;e&nbsp;efectuado&nbsp;o&nbsp;<br>
cálculo&nbsp;do&nbsp;tempo&nbsp;que&nbsp;o&nbsp;algoritmo&nbsp;demorou&nbsp;a&nbsp;ordenar.<br>
&nbsp;<br>
Retorna&nbsp;uma&nbsp;lista&nbsp;de&nbsp;tuplos&nbsp;em&nbsp;que&nbsp;cada&nbsp;tuplo&nbsp;contêm&nbsp;a&nbsp;lista&nbsp;de&nbsp;tamanho&nbsp;n&nbsp;e&nbsp;o&nbsp;tempo&nbsp;médio&nbsp;que&nbsp;demorou&nbsp;a&nbsp;executar</tt></dd></dl>

<dl><dt><a name="Algorithm-timeDeviation"><strong>timeDeviation</strong></a>(self, variance)</dt><dd><tt>Retorna&nbsp;o&nbsp;desvio&nbsp;padrão</tt></dd></dl>

<dl><dt><a name="Algorithm-timeError"><strong>timeError</strong></a>(self, deviance, n)</dt><dd><tt>Retorna&nbsp;o&nbsp;erro&nbsp;da&nbsp;amostra</tt></dd></dl>

<dl><dt><a name="Algorithm-timeMedium"><strong>timeMedium</strong></a>(self, T)</dt><dd><tt>Com&nbsp;base&nbsp;nos&nbsp;tempos&nbsp;guardados&nbsp;na&nbsp;lista&nbsp;T,&nbsp;retorna&nbsp;a&nbsp;média&nbsp;dos&nbsp;mesmos</tt></dd></dl>

<dl><dt><a name="Algorithm-timeVariance"><strong>timeVariance</strong></a>(self, T, medium)</dt><dd><tt>Com&nbsp;base&nbsp;nos&nbsp;tempos&nbsp;guardados&nbsp;na&nbsp;lista&nbsp;T&nbsp;e&nbsp;a&nbsp;média,&nbsp;retorna&nbsp;a&nbsp;variância</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-clock"><strong>clock</strong></a>(...)</dt><dd><tt><a href="#-clock">clock</a>()&nbsp;-&gt;&nbsp;floating&nbsp;point&nbsp;number<br>
&nbsp;<br>
Return&nbsp;the&nbsp;CPU&nbsp;time&nbsp;or&nbsp;real&nbsp;time&nbsp;since&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;process&nbsp;or&nbsp;since<br>
the&nbsp;first&nbsp;call&nbsp;to&nbsp;<a href="#-clock">clock</a>().&nbsp;&nbsp;This&nbsp;has&nbsp;as&nbsp;much&nbsp;precision&nbsp;as&nbsp;the&nbsp;system<br>
records.</tt></dd></dl>
</td></tr></table>
</body></html>
